<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <include file="./Application/Admin/View/block/easyui_header.php" />
    <style>
        #dg{
            height: 100%;;
        }
    </style>
</block>
<block name="bdoy">
    <body>
    <table id="grid_pump_log"></table>
    <div id="grid_pump_log_ToolBar" style="padding:5px;height:auto">
        <div id="queryParamZone_pump_log">
            <form id="queryForm_Pumplog" method="post" action="">
                <div>
                    <table>
                        <tr>
                            <td>设备状态：</td>
                            <td>
                                <select  name="status" style="width: 80px;">
                                    {:device_status_option()}
                                </select>
                            </td>
                            <td>从：</td>
                            <td><input class="easyui-datebox" name="start" style="width: 100px;"></td>
                            <td>到：</td>
                            <td><input class="easyui-datebox" name="end" style="width: 100px;"></td>
                            <td><span><a id="btnQueryPumplog" href="#" class="easyui-linkbutton" iconCls="icon-search">查询</a></span></td>
                            <td><a href="#" class="easyui-linkbutton" iconCls="icon-undo" onclick="javascript:$('#queryForm_Pumplog').form('clear');">重置</a></td>
                        </tr>
                    </table>

                </div>
            </form>
        </div>
    </div>

    </body>
</block>
<block name="footExtendJs">
    <script type="text/javascript">
        //$.noConflict();
        $(window).resize(function() {
            $('#grid_pump_log').datagrid('resize');
        });

        function clearpumplogForm(){
            $('#pumplogForm').form('clear');
        }

        function clearQueryParamZone(){
            $('#queryForm_Pumplog').form('clear');
        }

        $(function(){
            $('#grid_pump_log').datagrid({
                //title:'泵机',
                width: '100%',
                //height: 400,
                fit: true,
                nowrap: false,
                striped: true,
                collapsible:false,
                url:'/Manage/AdminCsdtPump/log_get_all',
                queryParams:{csdtpumpid:{:I('get.fy_id')},page:1,rows:20},
        method:'get',
            pageNumber:1,
            pageSize:20,
            idField:'id',
            remoteSort: false,
            columns:[[
            {field:'id',title:'序号',width:60,checkbox:true},
            {field:'sta_name',title:'调蓄池名称',width:180,align:'center'},
            {field:'p_number',title:'泵机编号',width:100,align:'center'},
            {field:'status',title:'设备状态',width:120,align:'center'},
            {field:'csdt_start',title:'开机时间',width:140,align:'center'},
            {field:'csdt_off',title:'关机时间',width:140,align:'center'},
            {field:'error_time',title:'故障时间',width:140,align:'center'},
            {field:'work_time',title:'运行时长(小时)', width:100,align:'center'},
            {field:'this_flow',title:'抽排量(m³)',width:100,align:'center'},
        ]],
            pagination:true,
            rownumbers:true,
            singleSelect:false,
            toolbar: '#grid_pump_log_ToolBar',

            rowStyler: function(index,row){
            if (row.status_index < 0){
                return 'background:rgba(255, 133, 133, 1);;color:#ffffff;';
            }
        },
        onLoadSuccess: function(data) {
            $(this).datagrid('resize');
        }
        });


        $('#btnSearchPumplog').click(function() {
            $('#queryParamZone_pump_log').toggle();
            if($('#queryParamZone_pump_log').is(":hidden")){
                clearQueryParamZone();
            }
            $('#grid_pump_log').datagrid("resize");
        });

        $('#btnQueryPumplog').click(function() {
            var obj = $('#queryForm_Pumplog').serializeJson();
            obj['csdtpumpid'] = {:I('get.fy_id')};
        $('#grid_pump_log').datagrid('load',obj);
        });

        /* WdatePicker({el:'pump_mdate',readOnly:true});
         $dp.hide(); */
        });


    </script>
</block>